package com.gitee.melin.bee.core.jdbc.dialect.greenplum;

import com.gitee.melin.bee.core.jdbc.dialect.DefaultTypeConvertor;
import com.gitee.melin.bee.core.jdbc.relational.ConnectionInfo;
import com.gitee.melin.bee.core.jdbc.enums.DataSourceType;
import com.gitee.melin.bee.core.jdbc.dialect.DataTypeConvertor;
import com.gitee.melin.bee.core.jdbc.dialect.AbstractJdbcDialect;
import com.gitee.melin.bee.core.jdbc.dialect.IDBQuery;
import com.gitee.melin.bee.core.jdbc.dialect.postgres.PostgreSqlQuery;

import java.sql.Connection;
import java.sql.Driver;
import java.sql.SQLException;

public class GreenplumJdbcDialect extends AbstractJdbcDialect {

    @Override
    public DataSourceType getDataSourceType() {
        return DataSourceType.GREENPLUM;
    }

    public GreenplumJdbcDialect(ConnectionInfo connectionInfo) {
        super(connectionInfo);
    }

    public GreenplumJdbcDialect(Connection connection) {
        super(connection);
    }

    @Override
    protected IDBQuery getDBQuery() {
        return new PostgreSqlQuery();
    }

    @Override
    protected DataTypeConvertor getTypeConvert() {
        return new DefaultTypeConvertor();
    }

    @Override
    protected Driver getDriver() throws SQLException {
        return loadDriver(DataSourceType.GREENPLUM.getDriverClass());
    }

    @Override
    public String getCreateTableScript(String databaseName, String tableName) {
        return "not support";
    }

    @Override
    protected String getDDLColumnName() {
        return "";
    }
}
